/** 
  实习基地管理
*/
<template>
  <div>
      <condition-card @reset="reset" @search="onSubmit" label-position="right" label-width="150px">
        <el-row :gutter="24" style="height: 50px;">
         
          <el-col :span="8">
              <el-form-item :label="$t('internship.internshipBase')">
                <el-input v-model="queryForm.condition.baseName"></el-input>
              </el-form-item>
          </el-col>
          <el-col :span="8">
              <el-form-item :label="$t('internship.baseLevel')">
                 <DictSelect v-model="queryForm.condition.baseLevel" :data="options.degreeType" :plzSelect="true"></DictSelect>
                <!-- <el-input v-model="queryForm.condition.department"></el-input> -->
              </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('internship.stopState')">
              <el-select v-model="queryForm.condition.isEnabled" clearable style="width: 100%">
                <el-option label="启用" :value="1"> </el-option>
                <el-option label="停用" :value="0"> </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
              <el-form-item :label="$t('internship.proviCity')">
                <SelectTree2 ref='proviCity' @change='changeInput' v-model="queryForm.condition.provinceCity" :labelDate="queryForm.condition.provinceCity" style="width:100%"/>
                <!-- <DictSelect v-model="queryForm.condition.proTitle" filterable @change="changeClick" :data="options.title" :plzSelect="true"></DictSelect> -->
                  <!-- <el-input v-model="queryForm.condition.provinceCity"></el-input> -->
              </el-form-item>
          </el-col>
          <el-col :span="8">
              <el-form-item :label="$t('graduate.college')">
                <DictSelect v-model="queryForm.condition.collegeAcademy" filterable @change="changeClick" :data="options.facultys" :plzSelect="true"></DictSelect>
                  
              </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('internship.currentStatus')">
              <el-select v-model="queryForm.condition.status" clearable style="width: 100%">
                <el-option label="草稿" :value="0"> </el-option>
                <el-option label="学校审核" :value="1"> </el-option>
                <el-option label="已审核" :value="2"> </el-option>
                <el-option label="已驳回" :value="3"> </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('internship.effectiveDate')" size="small" >
              <el-date-picker
                :placeholder="$t('internship.pleaseSelect')"
                style="width: 100%"
                v-model="queryForm.condition.startTimeStr"
                :picker-options="pickerOptionsStart"
                type="date"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
            <!--  -->
          </el-col>
          <el-col :span="8">
            <el-form-item :label="$t('internship.effectiveEnd')" size="small" >
              <el-date-picker
                :placeholder="$t('internship.pleaseSelect')"
                style="width: 100%"
                v-model="queryForm.condition.endTimeStr"
                :picker-options="pickerOptionsEnd"
                type="date"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <!--  -->
        </el-row>
      </condition-card>
      <el-card shadow="never" v-loading="loading" body-style="padding: 24px;" class="card-margin">
        <h1 class="condition-title">{{$t('graduate.internManagement')}}</h1>
        <!-- <div class="float-left associated-conditional-input">
          <KeywordInput v-model="queryForm.condition.baseName" :placeholder="$t('graduate.pleaseEnter')+$t('internship.internshipBase')"
            @enter="onSubmit"/>
        </div> -->
        <div class="edu-opertion-bar sub-title">
          <div class="float-right" style="display: flex;">
            
            <el-dropdown placement='bottom-start' trigger="click" @command="leadFile">
              <el-button v-if='leadBut' >{{$t('internship.lead')}}<i class="el-icon-arrow-down el-icon--right"></i></el-button>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item command="导入">{{$t('internship.lead')}}</el-dropdown-item>
                <el-dropdown-item command="下载">{{$t('internship.download')}}</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
            <el-upload 
              class="upload-demo"
              action="/api/practiceservice/base/import" 
              :on-success="changeSuccess"
              :auto-upload="true"
              style="display: none;"
              >
              <span slot="trigger" ref="importBtn">{{$t('graduate.clickUpload')}}</span>
              <!-- :data="category"<el-button size="small" ref='importBtn' type="primary">点击上传</el-button> -->
              <!-- :on-preview="handlePreview"
              :on-remove="handleRemove"
              :before-remove="beforeRemove"
              :on-exceed="handleExceed"
              :file-list="fileList"<div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div> -->
            </el-upload>
            
            <el-button v-if='deriveBut' style="margin-left:10px" @click="exportFile">{{$t('internship.derive')}}</el-button>
            <el-button v-if='batchReviewBut' @click="batchReview">{{$t('internship.batchReview')}}</el-button>
            <el-button v-if='blockUpBut' type="danger" @click="blockUp">{{$t('internship.blockUp')}}</el-button>
            <el-button v-if='startUsingBut' type="primary" @click="startUsin">{{$t('internship.startUsin')}}</el-button>
            <el-button type="primary" v-if='addBut' @click="exportAdd">{{$t('graduate.add')}}</el-button>
            <!-- <el-button @click="exportEdit">{{$t('graduate.edit')}}</el-button>
            <el-button @click="exportServe">{{$t('graduate.conserve')}}</el-button>
            <el-button type="primary" @click="addedLine">{{$t('internship.addedLine')}}</el-button>
            <el-button type="danger" @click="delline">{{$t('internship.delline')}}</el-button> -->
          </div>
        </div>
        <edu-table :pagination="false"  :tooltipEffect="tooltipEffect" stripe :data="dataList" size="mini" @selection-change="handleSelectionChange">
        
          <edu-table-column :label="$t('internship.internshipBase')" prop="baseName"></edu-table-column>
          <edu-table-column :label="$t('internship.baseLevel')" prop="baseLevel">
           <template slot-scope="scope">
            {{scope.row.baseLevel | collegeAcademyList(options.degreeType)}}
           </template>
          </edu-table-column>
          <edu-table-column :label="$t('internship.proviCity')" prop="provinceCity"></edu-table-column>
          <edu-table-column :label="$t('internship.siteCity')" prop="address"></edu-table-column>
          <edu-table-column :label="$t('graduate.college')" prop="collegeAcademy">
            <template slot-scope="scope">
              {{scope.row.collegeAcademy | collegeAcademyList(options.facultys)}}
           </template>
          </edu-table-column>
          <edu-table-column :label="$t('internship.effective')" prop="startTime">
            <template slot-scope="props">
              <span >{{ props.row.startTime+'/'+props.row.endTime }}</span>
              <!-- <span v-if="props.row.isEnabled == 1">启用</span> -->
            </template>
          </edu-table-column>
          <!-- <edu-table-column :label="$t('internship.introduc')" prop="introduction"></edu-table-column> -->
          <edu-table-column :label="$t('internship.stopState')" prop="isEnabled">
            
            <template slot-scope="scope">
              <div class="is-enabled-container">
                <el-button v-if="scope.row.isEnabled === 0" type="danger" plain>{{ scope.row.isEnabled | isEnabled }}</el-button>
                <el-button v-else type="success" plain>{{ scope.row.isEnabled | isEnabled }}</el-button>
              </div>
              <!-- <span v-if="props.row.isEnabled == 0">停用</span>
              <span v-if="props.row.isEnabled == 1">启用</span> -->
            </template>
          </edu-table-column>
          <edu-table-column :label="$t('internship.currentStatus')" prop="status">
            
            <template slot-scope="props">
              <span v-if="props.row.status == 0">草稿</span>
              <span v-if="props.row.status == 1">学校审核</span>
              <span v-if="props.row.status == 2">已审核</span>
              <span v-if="props.row.status == 3">已驳回</span>
            </template>
          </edu-table-column>
          <!-- <edu-table-column :label="$t('mainbase.initial')" prop="password"></edu-table-column> -->
          
          <edu-table-column :label="$t('graduate.operate')" fit align='center' >
            <template slot-scope="props">
              <el-row type="flex" class="row-bg" justify="center">
              <!-- 学校审核、已驳回状态操作栏无“特殊编辑”按钮 -->
              <el-button v-if='auditBut && props.row.actNo&&props.row.status!=2&&props.row.status!=3' type="text" @click="checkOutline(props.row)" >{{$t('internship.check')}}</el-button>
              <el-button v-if='specialEditBut&&props.row.status == 2' type="text" @click="specialEdit(props.row)" >{{$t('internship.specialEdit')}}</el-button>        
              <!-- <template v-if='editBut&&props.row.status!=1&&props.row.status!=2' > -->
                <div v-if='editBut&&props.row.status!=1&&props.row.status!=2'>

                  <el-button v-if="props.row.status == 3&&administrator||props.row.status == 0"  type="text" @click="editOutline(props.row)" >{{$t('graduate.edit')}}</el-button>
                  <!-- <el-button v-else="props.row.status == 0&&administrator"  type="text" @click="editOutline(props.row)" >{{$t('graduate.edit')}}</el-button> -->
                </div>
              <!-- </template> -->
              <el-button v-if='detailsBut' type="text" @click="detailsOutline(props.row)" >{{$t('graduate.details')}}</el-button>
              <!-- <template slot-scope="props" v-if='removeBut&&props.row.status!=1&&props.row.status!=2'> -->
                <div v-if='editBut&&props.row.status!=1&&props.row.status!=2'>
                  <el-button  v-if="props.row.status == 3&&administrator||props.row.status == 0" type="text" @click="deteOutline(props.row)" >{{$t('internship.dete')}}</el-button>
                </div>
              </el-row>
              <!-- </template> -->
            </template>
          </edu-table-column>
        </edu-table>
        <el-row type="flex" class="row-bg" justify="end">
          <el-col>
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="queryForm.pageNum_"
                :page-sizes="[20, 40, 80, 100]"
                :page-size="queryForm.pageSize_"
                layout="total, sizes, prev, pager, next, jumper"
                :total="queryForm.total_"
                style="float:right;margin-top:10px"
              ></el-pagination>
          </el-col>
        </el-row>
      </el-card>
      <el-dialog
        @close="dataObjit={}"
        :before-close='beforeClose'
        :title="title"
        width="70%"
        :visible.sync="addflag"
        :show-close="beforeClose">
        <settingAdd ref='addform' :dataListObj='queryForm' @cancel-dialog='changeClose' :dataProp='dataProp' :showFlag="addflag"  :dataListProp='dataObjit' 
        @close="(flag) => { addflag = flag }" @affirm-form="addrmForm" >
        </settingAdd>
      </el-dialog>
      <el-dialog
        :before-close='cancelClose'
        :title="$t('internship.batchReview')"
        width="70%"
        :visible.sync="dialogFormVisible"
        :show-close="cancelClose">
        <!-- batchReviewClose -->
        <el-form :model="form">
          <el-form-item :label="$t('internship.auditOpinion')" >
            <el-input v-model="form.content" type="textarea" :rows="5" maxlength="325"></el-input>
          </el-form-item>
        </el-form>
        <!-- <el-dialog
          width="25%"
          ref="innerDialog"
          :visible.sync="innerVisible"
          append-to-body
          :top="'28vh'">
          <div style="text-align: left;margin-bottom: 25px;">{{$t('graduateBase.cancelTip')}}</div>
          <div style="text-align: right;">
            <el-button type="primary" @click="confirmBtn">{{$t('common.btn.confirm')}}</el-button>
            <el-button @click="cancelBtn">{{$t('common.btn.cancel')}}</el-button>
            <el-button type="primary" @click="confirmAndBtn">{{$t('graduateBase.saveAndClose')}}</el-button>
          </div>
        </el-dialog> -->
        <div slot="footer" class="dialog-footer">
          <el-button @click="cancelClose">{{$t('graduate.cancel')}}</el-button>
          <el-button type="danger" @click="reject">{{$t('identificationToDoList.Reject')}}</el-button>
          <el-button type="primary" @click="pass">{{$t('identificationToDoList.adopt')}}</el-button>
        </div>
      </el-dialog>
      <el-dialog
        @close="dataEdit={}"
        :before-close='editClose'
        :title="$t('internship.specialEdit')"
        width="70%"
        :visible.sync="editflag"
        :show-close="editClose">
        <speciaEdit ref='editform' @cancel-eidt='dialogClose' :dataList='queryForm' :dataProp='editProp' :showFlag="editflag"  :dataListProp='dataEdit' 
        @close="(flag) => { editflag = false }" @affirm-edit="editrmForm" >
        </speciaEdit>
      </el-dialog>
      <el-dialog
        @close="tableClose"
        :title="$t('internship.internshipView')"
        width="70%"
        :before-close='tableClose'
        :visible.sync="tableFlag"
        :show-close="tableClose">
        <speciaView :showFlag="tableFlag" :dataList='queryForm' :databjit='databjit'  :dataListProp='tableObjit' @close="(flag) => { tableFlag = flag }"></speciaView>
      </el-dialog>
      <edu-export-dialog
        :disabled="exportButton"
        :title="$t('message.prompt')"
        ref="downloadRef"
        :data="exportResult">
      </edu-export-dialog>
  </div>
</template>
<script>
import { queryDic } from "common/src/api/dictionary";
import UTILS from "common/src/utils/utils";
import mainbaseView from 'common/src/views/graduateStudent/component/mainbaseView';
import settingAdd from 'common/src/views/graduateStudent/component/settingAdd';
import speciaEdit from 'common/src/views/graduateStudent/component/speciaEdit';
import speciaView from 'common/src/views/graduateStudent/component/speciaView';
import graduateStudent from 'common/src/api/graduateStudent/graduateStudent';
import SelectTree2 from 'common/src/views/graduateStudent/component/SelectTree2';
import filters from "common/src/filters";
export default {
  components: {
    mainbaseView,
    settingAdd,
    speciaEdit,
    SelectTree2,
    speciaView
  },
  data () {
    return {
      indexKey: '1', // 面包屑
      title: '',
      category: { category: 1 },
      mainbase: '专家',
      showDate: true,
      dialogFormVisible: false,
      addflag: false,
      tableFlag: false,
      editflag: false,
      editProp: '',
      dataEdit: {},
      tableObjit: {},
      databjit: [],
      peopleadd: {},
      curRow: {},
      form: {
        content: ''
      },
      ifDetials: false,
      copyDialog: false,
      curCalendarId: '',
      isAllDel: true,
      exportButton: false,
      exportResult: null,
      checkTopicListForm: {
        dataList: []
      },
      multipleSelection: [],
      provideData: {}, // 提供子组件表格数据
      queryForm: {
        pageNum_: 1,
        pageSize_: 20,
        total_: 0,
        condition:{
          // category: 1,
          baseName: '',
          baseLevel: '',
          isEnabled: '',
          provinceCity: '',
          endTimeStr: '',
          startTimeStr: '',
          status: '',
          collegeAcademy: '',
          collegeAcademyList: []
        }
      },
      dataListProp: {},
      dataProp: '',
      copyTime: {
        time: ''
      },
      options: {
        facultys: [],
        degreeType: [],
        title: [],
        sex: [],
        auditStatus: [
          {
            label: '待提交',
            value: 0
          },
          {
            label: '待审核',
            value: 1
          },
          {
            label: '审核通过',
            value: 2
          },
          {
            label: '驳回',
            value: 3
          },
          {
            label: '待录入',
            value: 4
          }
        ]
      },
      pickerOptionsStart: {
        disabledDate: time => {
          let endDateVal = this.queryForm.condition.endTimeStr;
          if (endDateVal) {
            return time.getTime() > new Date(endDateVal).getTime();
          }
        }
      },
      pickerOptionsEnd: {
        disabledDate: time => {
          let beginDateVal = this.queryForm.condition.startTimeStr;
          if (beginDateVal) {
            return time.getTime() <= new Date(beginDateVal).getTime()- 86400000;
          }
        }
      },
      queryList: {
        calendarId: '',
        faculty: '',
        status: '',
        course: ''
      },
      rules: {
       
      },
      auths: [],
      rulesForm: {
       
      },
      dataList: [],
      addBut: false,
      editBut: false,
      specialEditBut: false,
      detailsBut: false,
      deriveBut: false,
      leadBut: false,
      auditBut: false,
      removeBut: false,
      batchReviewBut: false,
      startUsingBut: false,
      blockUpBut: false,
      administrator: false, // 管理员
      acdemic: false, // 教务员
      manager: false, // 基地管理员
      breadPath: {
        label: this.$t('graduate.graduate'),
        key: "1",
        children: [
          {
            key: "2",
            label: ""
          }
        ]
      },
    }
  },
  watch: {
    'auths': {
      handler: function(value) {
        this.auths.some(item => {
          if (item.authCode === 'settingInternshipBase-addBut') {
            // 新增
            this.addBut = true;
          }
          if (item.authCode === 'settingInternshipBase-editBut') {
            // 编辑
            this.editBut = true;
          }
          if (item.authCode === 'settingInternshipBase-specialEditBut') {
            // 特殊编辑
            this.specialEditBut = true;
          }
          if (item.authCode === 'settingInternshipBase-detailsBut') {
            // 详情
            this.detailsBut = true;
          }
          if (item.authCode === 'settingInternshipBase-deriveBut') {
            // 导出
            this.deriveBut = true;
          }
          if (item.authCode === 'settingInternshipBase-leadBut') {
            // 导入
            this.leadBut = true;
          }
          if (item.authCode === 'settingInternshipBase-auditBut') {
            // 审核
            this.auditBut = true;
          }
          if (item.authCode === 'settingInternshipBase-removeBut') {
            // 删除
            this.removeBut = true;
          }
          if (item.authCode === 'settingInternshipBase-batchReviewBut') {
            // 批量审核
            this.batchReviewBut = true;
          }
          if (item.authCode === 'settingInternshipBase-startUsingBut') {
            // 启用
            this.startUsingBut = true;
          }
          if (item.authCode === 'settingInternshipBase-blockUpBut') {
            // 停用
            this.blockUpBut = true;
          }
        });
      },
      deep: true
    }
  },
  filters: {
    collegeAcademyList(val, array) {
      let str = "";
      for (let item of array) {
        if (val === item.value) {
          str = item.label;
        }
      }
      return str;
    },
    isEnabled(val) {
      switch (val) {
        case 0:
          return '停用'
        case 1:
          return '启用'
        default:
          return val
      }
    },
  },
  created() {
    this.getOptions();
    this.postInternshipBase(this.queryForm);
    this.auths = JSON.parse(localStorage.getItem("sessiondata")).auths;
    this.auths.some(item => {
      if (item.authCode === 'settingInternshipBase-addBut') {
        // 新增
        this.addBut = true;
      }
      if (item.authCode === 'settingInternshipBase-editBut') {
        // 编辑
        this.editBut = true;
      }
      if (item.authCode === 'settingInternshipBase-specialEditBut') {
        // 特殊编辑
        this.specialEditBut = true;
      }
      if (item.authCode === 'settingInternshipBase-detailsBut') {
        // 详情
        this.detailsBut = true;
      }
      if (item.authCode === 'settingInternshipBase-deriveBut') {
        // 导出
        this.deriveBut = true;
      }
      if (item.authCode === 'settingInternshipBase-leadBut') {
        // 导入
        this.leadBut = true;
      }
      if (item.authCode === 'settingInternshipBase-auditBut') {
        // 审核
        this.auditBut = true;
      }
      if (item.authCode === 'settingInternshipBase-removeBut') {
        // 删除
        this.removeBut = true;
      }
      if (item.authCode === 'settingInternshipBase-batchReviewBut') {
        // 批量审核
        this.batchReviewBut = true;
      }
      if (item.authCode === 'settingInternshipBase-startUsingBut') {
        // 启用
        this.startUsingBut = true;
      }
      if (item.authCode === 'settingInternshipBase-blockUpBut') {
        // 停用
        this.blockUpBut = true;
      }
    });
  },
  mounted() {
    graduateStudent.getCurrentRole().then(res => {
      // console.log(res, 'res');
      if (res.data === '管理员') {
        this.administrator = false;
      } else if (res.data === '教务员') {
        this.administrator = true;
      } else if (res.data === '基地管理员') {
        // this.administrator = true;
      }
      
    });
  },
  methods: {
    changeInput(val, data) {
      data.forEach(el => {
        if (el.label.indexOf(val) < 0) {
          this.queryForm.condition.provinceCity = '';
          // this.$refs.proviCity.cancelDialog();
        }
      });
      if (!val) {
        this.queryForm.condition.provinceCity = '';
      }
    },
    postInternshipBase(date) {
      graduateStudent.internshipBase(date).then(res => {
        // this.queryForm.pageNum_ = res.data.pageNum_;
        // this.queryForm.pageSize_ = res.data.pageSize_;
        this.queryForm.total_ = res.data.total_;
        this.dataList = res.data.list;
      });
    },
    getOptions() {
      // 筛选条件字典查询
      let data = {
        lang: this.$store.getters.language || "cn",
        type: "allChild",
        keys: ["X_YX", 'G_XBIE', "JDJB",]
      };
      queryDic(data).then(res => {
        UTILS.fillSelect(
          {
            facultys: "X_YX",
            degreeType: "JDJB",
            sex:"G_XBIE"
          },
          res.data,
          this.options
        );
      });
      
    },
    changeClick(val) {
      this.queryForm.condition.collegeAcademyList = [];
      if (val) {

        this.queryForm.condition.collegeAcademyList.push(val);
      } else {
        this.queryForm.condition.collegeAcademyList = [];
      }
      
    },
    // 导入
    leadFile(command) {
      if (command === '导入') {
        this.channel = true;
        this.$refs.importBtn.click();
      } else if (command === '下载') {
        graduateStudent.internshipDownTemplate().then(res => {
          this.$message(this.$t('internship.successfully'));
        });
      }
    },
    changeSuccess(res) {
      if(res.msg){
        this.$message({type: "info", message: res.msg});
      }else{
        // this.$message(this.$t('internship.successfully'));
        this.$message({type: "success", message: this.$t('internship.successfully')});
        this.queryForm.pageNum_ = 1;
        this.postInternshipBase(this.queryForm);
        // this.$message({type: "success", message: this.$t('message.addSuccess')});
      }
    },
    // 轮询直到获取key值的接口返回
    cycleToGetKey() {
      setTimeout(() => {
        let currentIds = [];
        if (this.multipleSelection.length > 0) {
          this.multipleSelection.forEach((element) => {
            currentIds.push(element.id);
          });
        } else {
          this.dataList.forEach((element) => {
            currentIds.push(element.id);
          });
        }
        graduateStudent.specialist({
          "templateName": this.queryForm.condition.department,
          "baseLevel": this.queryForm.condition.proTitle,
          "isEnabled": this.queryForm.condition.isEnabled,
          "name": this.queryForm.condition.name,
          "sex": this.queryForm.condition.sex,
          // "category": this.queryForm.condition.category,
          "selectRowIds": currentIds
        }).then(res => {
          if (res.success) {
            this.$refs.downloadRef.close();
            this.exportButton = false;
            this.normalDelayRequest(res.key, res.msg);
          } else {
            this.cycleToGetKey();
          }
        });
      }, 3000);
    },
    // 导出异步
    delayRequest(key, name) {
      setTimeout(() => {
        graduateStudent.downloadGetKey(key, name).then(res => {
          this.exportResult = res.data;
          if (res.code == 200 && res.data.status) {
            this.exportButton = false;
            let path =
              '/api/practiceservice/export/file?path=' +
              res.data.path + '&name=' + name;
            // window.open(path);
            window.location.href = path;
            this.$message.success(this.$t('result.exportSuccessfully'));
            this.$refs.downloadRef.close();
          } else {
            this.delayRequest(key, name);
          }
        });
      }, 3000);
    },
    // Normal导出异步
    normalDelayRequest(key, name) {
      setTimeout(() => {
        graduateStudent.downloadGetKey(key).then(res => {
          this.exportResult = res.data;
          if (res.code == 200 && res.data.status) {
            this.exportButton = false;
            let path =
              '/api/practiceservice/export/file?path=' +
              res.data.path + '&name=' + name;
            // window.open(path);
            window.location.href = path;
            this.$message.success(this.$t('result.exportSuccessfully'));
            this.$refs.downloadRef.close();
          } else {
            this.delayRequest(key, name);
          }
        });
      }, 3000);
    },
    // 导出
    exportFile(command) {
      // 1、第一步：调该接口，获取key值以及msg中的文件名
      // 2、第二步：将key值放入接口传参
      // 3、第三步：传入path值以及name(msg中的文件名)值，下载文件
      let list = JSON.parse(JSON.stringify(this.multipleSelection));
      if (list.length > 0) {
        list.forEach(el => {
          this.options.degreeType.forEach(ele => {
            if (el.baseLevel === ele.value) {
              el.baseLevel = ele.label;
            }
          });
          this.options.facultys.forEach(ele => {
            if (el.collegeAcademy === ele.value) {
              el.collegeAcademy = ele.label;
            }
          });
          el.effectedDateStart = el.startTime;
          el.effectedDateEnd = el.endTime;
          el.enableStatus = el.isEnabled === 0 ? '停用' : '启用';
        });
      } else {
        this.multipleSelection = [];
      }
      let obj = {
        baseExportDTOList: list,
        baseSearchCondition: this.queryForm.condition
      };
      
      
      graduateStudent.internshipExportList(obj).then(() => {
        this.$message(this.$t('internship.successfully'));
      });
      // this.exportResult = null;
      // this.$refs.downloadRef.open();
      // this.exportButton = true;
      // this.cycleToGetKey();
      
    },
    // 特殊编辑关闭
    editClose() {
      this.$refs.editform.cancelDialog();
    },
    // 特殊编辑关闭
    dialogClose() {
      this.editflag = false;
    },
    // 特殊编辑保存
    editrmForm(param, list) {
      graduateStudent.specialEdit(param).then(res => {
        this.$message.success(this.$t('internship.successfully')); 
            
          this.editflag = false;
          // this.queryForm.pageNum_ = 1;
          this.queryForm.condition.collegeAcademyList = [];
          if (list.collegeAcademy) {

            list.condition.collegeAcademyList.push(list.collegeAcademy);
          } else {
            this.queryForm.condition.collegeAcademyList = [];
          }
          this.postInternshipBase(list);
          this.$refs.editform.confirmInner();
          this.$refs.editform.proviCityDialog();
      });
    },
    
    // 搜索/筛选
    onSubmit() {
      this.queryForm.pageNum_ = 1;
      this.postInternshipBase(this.queryForm);
    },
    // 停用
    blockUp() {
      if (this.multipleSelection.length > 0) {
        let list = [];
        this.multipleSelection.forEach(el => {
          list.push(el.id);
        });
        graduateStudent.internDisable(list).then(() => {
          this.$message({
            type: 'success',
            message: this.$t('internship.successfully')
          });
          this.queryForm.pageNum_ = 1;
          this.queryForm.condition.collegeAcademyList = [];
          if (this.queryForm.condition.collegeAcademy) {

            this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
          } else {
            this.queryForm.condition.collegeAcademyList = [];
          }
          this.postInternshipBase(this.queryForm);
        });
      } else {
        return this.$message.warning(this.$t('internship.selectManipulate'));
      }
    },
    // 启用
    startUsin() {
      if (this.multipleSelection.length > 0) {
        let list = [];
        this.multipleSelection.forEach(el => {
          list.push(el.id);
        });
        graduateStudent.internEnable(list).then(() => {
          this.$message({
            type: 'success',
            message: this.$t('internship.successfully')
          });
          this.queryForm.pageNum_ = 1;
          this.queryForm.condition.collegeAcademyList = [];
          if (this.queryForm.condition.collegeAcademy) {

            this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
          } else {
            this.queryForm.condition.collegeAcademyList = [];
          }
          this.postInternshipBase(this.queryForm);
        });
      } else {
        return this.$message.warning(this.$t('internship.selectManipulate'));
        
      }
    },
    // 批量审核
    batchReview() {
      if (this.multipleSelection.length > 0) {
        let list = [];
        let isEnabled = [];
        this.multipleSelection.forEach(el => {
          if (el.status != 2 && el.status != 3 && el.actNo) {
            list.push(el.id);
            isEnabled.push(true);
          } else {
            isEnabled.push(false);
            
          }
        });

        if (isEnabled.includes(false)) {
          this.$message(this.$t('internship.pleaseCheck'));
          return this.dialogFormVisible = false;
        } else {
          return this.dialogFormVisible = true;
        }
        // graduateStudent.internDisable(list).then(() => {
        //   this.$message({
        //     type: 'success',
        //     message: this.$t('internship.successfully')
        //   });
        //   this.queryForm.pageNum_ = 1;
        //   this.queryForm.condition.collegeAcademyList = [];
        //   if (this.queryForm.condition.collegeAcademy) {

        //     this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
        //   } else {
        //     this.queryForm.condition.collegeAcademyList = [];
        //   }
        //   this.postInternshipBase(this.queryForm);
        // });
      } else {
        return this.$message.warning(this.$t('internship.selectManipulate'));
        
      }
    },
    // 批量审核取消
    cancelClose() {
      this.dialogFormVisible = false;
      this.form.content = '';
    },
    // 批量审核驳回
    reject() {
      if (this.form.content.indexOf("$") < 0) {
        if (this.form.content) {
            let practiceIds = [];
            this.multipleSelection.forEach(el => {
              practiceIds.push({
                content: this.form.content,
                no: el.actNo
              });
            });
            graduateStudent.internshipRefuse(practiceIds).then((data) => {
              this.$message({
                  type: "success",
                  message: this.$t('identificationToDoList.SuccessfulOperation')
              });
              this.queryForm.pageNum_ = 1;
              this.queryForm.condition.collegeAcademyList = [];
              if (this.queryForm.condition.collegeAcademy) {

                this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
              } else {
                this.queryForm.condition.collegeAcademyList = [];
              }
              this.postInternshipBase(this.queryForm);
              this.dialogFormVisible = false;
            });
        } else {
          this.$message({
              type: "error",
              message: this.$t('myExamine.reviewComments')
          });
        }
      } else {
        this.$message({
            type: "error",
            message: this.$t('identificationToDoList.cannotContain')
        });
      }
    },
    // 批量审核通过
    pass() {
      if (this.form.content.indexOf("$") < 0) {
        let practiceIds = [];
        this.multipleSelection.forEach(el => {
          practiceIds.push({
            content: this.form.content,
            no: el.actNo
          });
        });
        graduateStudent.internshipAgree(practiceIds).then((data) => {
          this.$message({
              type: "success",
              message: this.$t('identificationToDoList.SuccessfulOperation')
          });
          this.queryForm.pageNum_ = 1;
          this.queryForm.condition.collegeAcademyList = [];
          if (this.queryForm.condition.collegeAcademy) {

            this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
          } else {
            this.queryForm.condition.collegeAcademyList = [];
          }
          this.postInternshipBase(this.queryForm);
          this.dialogFormVisible = false;
        });
      } else {
        this.$message({
            type: "error",
            message: this.$t('identificationToDoList.cannotContain')
        });
      }
    },
    // 新增
    exportAdd() {
      this.title = this.$t('internship.applicaInternship');
      this.dataProp = '新增';
      this.dataObjit = {};
      // this.mainbase = '专家';
      this.addflag = true;
    },
    // 取消
    changeClose(param) {
      this.addflag = param;
    },
    // 取消
    beforeClose(param) {
      this.$refs.addform.cancelDialog();
    },
    tableClose() {
      this.tableFlag = false;
    },
    // 新增保存（编辑保存）
    addrmForm(param, data, list) {
      if (this.dataProp === '编辑') {
        // if (data === 'conserve') {
          graduateStudent.internshipEdit(param).then(res => {
            this.$message.success(this.$t('internship.successfully')); 
            this.$refs.addform.proviCityDialog();
            this.addflag = false;
            // this.queryForm.pageNum_ = 1;
            this.queryForm.condition.collegeAcademyList = [];
            if (list.collegeAcademy) {

              list.condition.collegeAcademyList.push(list.collegeAcademy);
            } else {
              this.queryForm.condition.collegeAcademyList = [];
            }
            this.postInternshipBase(list);
            this.$refs.addform.confirmInner();
          });
        // } else {
        //   graduateStudent.internshipEdit(param).then(res => {
        //     this.$message.success(this.$t('internship.successfully')); 
        //     this.addflag = false;
        //     // this.queryForm.pageNum_ = 1;
        //     this.queryForm.condition.collegeAcademyList = [];
        //     if (list.collegeAcademy) {

        //       list.condition.collegeAcademyList.push(list.collegeAcademy);
        //     } else {
        //       this.queryForm.condition.collegeAcademyList = [];
        //     }
        //     this.postInternshipBase(list);
        //     this.$refs.addform.confirmInner();
        //   });
        // }
      } else if (this.dataProp === '新增') {
        // if (data === 'conserve') {
        //   graduateStudent.internshipAdd(param).then(res => {
        //     this.$message.success(this.$t('internship.successfully')); 
            
        //     this.addflag = false;
        //     // this.queryForm.pageNum_ = 1;
        //     this.queryForm.condition.collegeAcademyList = [];
        //     if (list.collegeAcademy) {

        //       list.condition.collegeAcademyList.push(list.collegeAcademy);
        //     } else {
        //       this.queryForm.condition.collegeAcademyList = [];
        //     }
        //     this.postInternshipBase(list);
        //     this.$refs.addform.confirmInner();
        //   });
        // } else {
          graduateStudent.internshipAdd(param).then(res => {
            this.$message.success(this.$t('internship.successfully')); 
            this.$refs.addform.proviCityDialog();
            this.addflag = false;
            // this.queryForm.pageNum_ = 1;
            this.queryForm.condition.collegeAcademyList = [];
            // if (list.collegeAcademy) {

            //   list.condition.collegeAcademyList.push(list.collegeAcademy);
            // } else {
            //   this.queryForm.condition.collegeAcademyList = [];
            // }
            this.postInternshipBase(this.queryForm);
            this.$refs.addform.confirmInner();
          });
        // }
        
      }
      
    },
    addCancel(data) {
      this.addflag = data;
    },
    
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 特殊编辑
    specialEdit(row) {
      graduateStudent.internGetDetail(row.id).then(res => {
        this.editProp = '特殊编辑';
        this.editflag = true;
        this.dataEdit = res.data;
      });
      
    },
    // 审核
    checkOutline(row) {
      let dataObj = {};
      graduateStudent.internGetDetail(row.id).then(res => {
        dataObj = res.data;
        
      }).then(() => {
        graduateStudent.getActDetailAudit(row.actNo).then(res => {
          this.$router.push({
            path: '/myExamineAudit',
            query: { 
              data: dataObj,
              list: res.data
            }
          });
        });
      });
      
    },
    // 删除
    deteOutline(row) {
      this.$confirm(this.$t('internship.deleteDate'), this.$t('internship.systemPrompt'), {
          confirmButtonText: this.$t('graduate.define'),
          cancelButtonText: this.$t('graduate.cancel'),
          type: 'warning'
        }).then(() => {
          let list = [];
          list.push(row.id);
          graduateStudent.internDelete(list).then(res => {
            this.$message({
              type: 'success',
              message: this.$t('internship.successfully')
            });
            this.queryForm.pageNum_ = 1;
            this.queryForm.condition.collegeAcademyList = [];
            if (this.queryForm.condition.collegeAcademy) {

              this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
            } else {
              this.queryForm.condition.collegeAcademyList = [];
            }
            this.postInternshipBase(this.queryForm);
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: this.$t('internship.cancelOpera')
          });          
        });
      
      // 'internDelete': internDelete,
    },
    // 编辑
    editOutline(row) {
      graduateStudent.internGetDetail(row.id).then(res => {
        this.title = this.$t('graduate.edit');
        this.dataProp = '编辑';
        this.dataObjit = res.data;
        this.addflag = true;
      });
    },
    // 详情
    detailsOutline(row) {
      graduateStudent.internGetDetail(row.id).then(res => {
        this.tableObjit = res.data;
      }).then(() => {
        graduateStudent.getActDetailAudit(row.actNo).then(res => {
          this.databjit = res.data;
          this.tableFlag = true;
        });
      });
    },
    // 关闭弹框
    changeProp() {
      this.addflag = false;
    },
    // 查看考核指标表
    indicatorsList() {},
    // 重置
    reset() {
      for (let key in this.queryForm.condition) {
        if (key !== 'category') {

          this.queryForm.condition[key] = '';
        }
      }
      this.queryForm.pageNum_ = 1;
      this.queryForm.condition.collegeAcademyList = [];
      if (this.queryForm.condition.collegeAcademy) {

        this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
      } else {
        this.queryForm.condition.collegeAcademyList = [];
      }
      this.$refs.proviCity.cancelDialog();
      this.postInternshipBase(this.queryForm);
    },
    // 保存
    conserve() {
      this.addflag = false;
    },
   
    diaCancel() {
      this.$refs['copyTime'].resetFields();
      this.copyDialog = false;
    },
   
    // dialogClose() {
    //   this.copyDialog = false;
    //   this.$refs['copyTime'].resetFields();
    // },
    handleSizeChange(val) {
      this.queryForm.pageSize_ = val;
      this.queryForm.pageNum_ = 1;
      this.queryForm.condition.collegeAcademyList = [];
      if (this.queryForm.condition.collegeAcademy) {

        this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
      } else {
        this.queryForm.condition.collegeAcademyList = [];
      }
      this.postInternshipBase(this.queryForm);
    },
    handleCurrentChange(val) {
      this.queryForm.pageNum_ = val;
      this.queryForm.condition.collegeAcademyList = [];
      if (this.queryForm.condition.collegeAcademy) {

        this.queryForm.condition.collegeAcademyList.push(this.queryForm.condition.collegeAcademy);
      } else {
        this.queryForm.condition.collegeAcademyList = [];
      }
      this.postInternshipBase(this.queryForm);
    }
    
  }
  
}
</script>
<style lang="scss" scoped>
.is-enabled-container ::v-deep {
    .el-button {
      cursor: auto;
    }
    .el-button--danger {
      padding: 9px 15px;
      min-width: 0;
    }
}
.condition-title {
  color: #2b3b4e;
  font-size: 18px;
  line-height: 24px;
  font-weight: bold;
}
  .edu-page-title {
    span {
      line-height: 24px;
      display: inline-block;
      padding-right: 10px;
      font-size: 18px;
      font-weight: bold;
      color: #2b3b4e;
    }
  }
  .sub-title {
    margin: 16px 0;
    font-size: 16px;
    color: #000020;
    letter-spacing: 0;
  }
  .form-item {
    width: 312px;
    height: 32px;
    float: left;
    margin: 0px 10px;
  }
  .inputBox{
    width: 240px!important;height: 32px!important;
  }
  .atooltip{
    background: beige;
    border: black;
  }
</style>
